
 
 F u n c t i o n :   p r e l o a d I m a g e s ( d o m E l e m e n t O r S t r i n g M a r k u p ) 
 
 
 
 S h o r t h a n d :   p r e l o a d ( d o m E l e m e n t O r S t r i n g M a r k u p ) 
 
 
 
 D e s c r i p t i o n :   W i l l   p r e l o a d   e m b e d d e d   i m a g e s   i n t o   t h e   D O M   i n   p r e p a r a t i o n   f o r   i n s t a n t   r e n d e r i n g   l a t e r . 
 
 
 
 R e t u r n s :   U n m o d i f i e d   O b j e c t . 
 
 
 
 N o t e :   T h e   p r e l o a d I m a g e s ( )   f u n c t i o n   w i l l   p a r s e   H T M L   m a r k u p   o r   q u e r y   a   D O M   c o n t a i n e r   e l e m e n t   t o   l o c a t e   a l l   < i m g / >   e l e m e n t s   a n d   p r e l o a d   t h e s e   w i t h i n   t h e   p a g e   s o   t h e y   d o w n l o a d   b e f o r e   t h e y   a r e   m e a n t   t o   b e   r e n d e r e d .   T h i s   e n s u r e s   i n s t a n t   r e n d e r r i n g   w h e n   t h e y   a r e   m e a n t   t o   b e   s e e n   v i s u a l l y . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   P r e l o a d   i m a g e s   w i t h i n   H T M L   m a r k u p . 
 
 $ A . p r e l o a d I m a g e s ( ' < d i v   c l a s s = " c a r o u s e l - s l i d e - 1 " > < i m g   s r c = " f i l e / p a t h / s l i d e 1 . j p g "   / > < / d i v > ' ) ; 
 
 
 
 / /   P r e l o a d   i m a g e s   w i t h i n   a   D O M   c o n t a i n e r   e l e m e n t . 
 
 $ A . p r e l o a d I m a g e s ( d o m C o n t a i n e r E l e m e n t ) ; 
 
 
 
 / /   O r   t h e   s a m e   u s i n g   c h a i n i n g 
 
 
 
 / /   P r e l o a d   i m a g e s   w i t h i n   H T M L   m a r k u p . 
 
 v a r   m y C h a i n   =   $ A ( ' < d i v   c l a s s = " c a r o u s e l - s l i d e - 1 " > < i m g   s r c = " f i l e / p a t h / s l i d e 1 . j p g "   / > < / d i v > ' ) . p r e l o a d I m a g e s ( ) ; 
 
 
 
 / /   P r e l o a d   i m a g e s   w i t h i n   a   D O M   c o n t a i n e r   e l e m e n t . 
 
 v a r   m y C h a i n   =   $ A ( d o m C o n t a i n e r E l e m e n t ) . p r e l o a d I m a g e s ( ) ; 
 
 
 
 / /   T o   r e t u r n   t h e   m o d i f i e d   o b j e c t   w i t h i n   a   c h a i n ,   u s e   t h e   " r e t u r n ( ) "   m e t h o d . 
 
 
 
 v a r   m y O b j e c t   =   m y C h a i n . r e t u r n ( ) ; 
 
 